package org.sai.wxnovel.service;

import org.sai.wxnovel.bean.Book;
import org.sai.wxnovel.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookDao bookDao;


    public List<Book> getBooksOfGenres(Integer id, Integer pageNum, Integer pageSize) {
        Integer start=(pageNum-1)*pageSize;
        return bookDao.findByGenres(id,start,pageSize);
    }

    public Integer getCountOfGenres(Integer id){
        return bookDao.findCountOfGenres(id);
    }
}
